package com.smartmedical.doctor.medic.controller;

import com.smartmedical.common.core.domain.HealthR;
import com.smartmedical.doctor.medic.domain.dto.param.DoctorIdCardParam;
import com.smartmedical.doctor.medic.domain.vo.*;
import com.smartmedical.doctor.medic.service.MedicVerifyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

import static com.smartmedical.common.core.utils.PageUtils.startPage;

@RestController
@RequestMapping("verify/v1")
public class MedicVerifyController {
    @Autowired
    MedicVerifyService medicVerifyService;
    //根据医生id查询医生信息
    @GetMapping("findDoctorById")
    public HealthR<DoctorInfoVo> findDoctorById(){
        return medicVerifyService.findDoctorById();
    }

    //上传形象照
    @PostMapping("uploadImagePic")
    public HealthR<String> uploadImagePic(@RequestParam("imagePic") MultipartFile imagePic){
        return medicVerifyService.uploadImagePic(imagePic);
    }
    //选择系统提供形象照
    @PostMapping("chooseImagePic")
    public HealthR chooseImagePic(@RequestParam String imagePic){
        return medicVerifyService.chooseImagePic(imagePic);
    }

    //绑定银行卡
    @PostMapping("bindDoctorBankCard")
    public HealthR bindDoctorBankCard(@RequestParam String bankCardNumber, @RequestParam String bankName, @RequestParam Integer bankCardType){
        return medicVerifyService.bindDoctorBankCard(bankCardNumber, bankName, bankCardType);
    }
    //查询医生银行卡信息
    @GetMapping("findDoctorBankCardById")
    public HealthR<List<DoctorBankCardVo>> findDoctorBankCardById(){
        return medicVerifyService.findDoctorBankCardById();
    }

    //绑定身份证
    @PostMapping("bindDoctorIdCard")
    public HealthR bindDoctorIdCard(@RequestBody DoctorIdCardParam doctorIdCardParam){
        return medicVerifyService.bindDoctorIdCard(doctorIdCardParam);
    }

    //查询医生身份证信息
    @GetMapping("findDoctorIdCardInfo")
    public HealthR<DoctorIdCardVo> findDoctorIdCardInfo(){
        return medicVerifyService.findDoctorIdCardInfo();
    }

    //查询用户提现记录
    @GetMapping("findDoctorDrawRecordList")
    public HealthR<List<DoctorDrawRecordVo>> findDoctorDrawRecordList(@RequestParam Integer page, @RequestParam Integer count) {
        startPage(page, count);
        HealthR<List<DoctorDrawRecordVo>> doctorDrawRecordVoList = medicVerifyService.findDoctorDrawRecordList();
        return doctorDrawRecordVoList;
    }

    //查询医生收支记录
    @GetMapping("findDoctorIncomeRecordList")
    public HealthR<List<DoctorIncomeRecordVo>> findDoctorIncomeRecordList(@RequestParam Integer page, @RequestParam Integer count) {
        startPage(page, count);
        HealthR<List<DoctorIncomeRecordVo>> doctorDrawRecordVoList = medicVerifyService.findDoctorIncomeRecordList();
        return doctorDrawRecordVoList;
    }

    //查询医生钱包
    @GetMapping("findDoctorWallet")
    public HealthR<DoctorWalletVo> findDoctorWallet() {

        return medicVerifyService.findDoctorWallet();
    }

    //提现
    @PostMapping("drawCash")
    public HealthR drawCash(@RequestParam Integer money) {
        return medicVerifyService.drawCash(money);
    }

    //添加医生极光推送token
    @PostMapping("addDoctorPushToken")
    public HealthR addDoctorPushToken(@RequestParam String token) {
        return medicVerifyService.addDoctorPushToken(token);
    }

    //查询医生收支记录
    @GetMapping("findDoctorGiftList")
    public HealthR<List<DoctorEvaluateVo>> findDoctorGiftList(@RequestParam Integer page, @RequestParam Integer count) {
        startPage(page, count);
        HealthR<List<DoctorEvaluateVo>> doctorDrawRecordVoList = medicVerifyService.findDoctorGiftList();
        return doctorDrawRecordVoList;
    }

    //查询系统通知消息
    @GetMapping("findDoctorSystemNoticeList")
    public HealthR<List<DoctorSystemNoticeVo>> findDoctorSystemNoticeList(@RequestParam Integer page, @RequestParam Integer count) {
        startPage(page, count);
        HealthR<List<DoctorSystemNoticeVo>> doctorDrawRecordVoList = medicVerifyService.findDoctorSystemNoticeList();
        return doctorDrawRecordVoList;
    }

    //查询系统通知消息
    @GetMapping("findDoctorInquiryNoticeList")
    public HealthR<List<DoctorSystemNoticeVo>> findDoctorInquiryNoticeList(@RequestParam Integer page, @RequestParam Integer count) {
        startPage(page, count);
        HealthR<List<DoctorSystemNoticeVo>> doctorDrawRecordVoList = medicVerifyService.findDoctorInquiryNoticeList();
        return doctorDrawRecordVoList;
    }

    //查询H币通知消息
    @GetMapping("findDoctorHealthyCurrencyNoticeList")
    public HealthR<List<DoctorSystemNoticeVo>> findDoctorHealthyCurrencyNoticeList(@RequestParam Integer page, @RequestParam Integer count) {
        startPage(page, count);
        HealthR<List<DoctorSystemNoticeVo>> doctorDrawRecordVoList = medicVerifyService.findDoctorHealthyCurrencyNoticeList();
        return doctorDrawRecordVoList;
    }

    //查询H币通知消息
    @GetMapping("findDoctorNoticeReadNum")
    public HealthR<List<DoctorNoticeReadNumVo>> findDoctorNoticeReadNum() {
        HealthR<List<DoctorNoticeReadNumVo>> doctorDrawRecordVoList = medicVerifyService.findDoctorNoticeReadNum();
        return doctorDrawRecordVoList;
    }

    //修改消息状态为全部已读
    @PutMapping("modifyAllStatus")
    public HealthR modifyAllStatus() {
        return medicVerifyService.modifyAllStatus();
    }

    //查询我的被采纳的建议
    @GetMapping("findMyAdoptedCommentList")
    public HealthR findMyAdoptedCommentList(@RequestParam Integer page, @RequestParam Integer count) {
        startPage(page, count);
        HealthR<List<UserAdoptCommentVo>> doctorDrawRecordVoList = medicVerifyService.findMyAdoptedCommentList();
        return doctorDrawRecordVoList;
    }




}
